let submit = require("../servies/loginsubmit.js");
module.exports = {
    router: async ctx => {
        await ctx.render("login.html")
    },

    getsubmit: ctx => {
        
        let username = ctx.request.body.username;
        let pwd = ctx.request.body.pwd;
        let data = ctx.request.body;
        // console.log(data);
        let res = submit.getsubmit(username, pwd);
        let info
        if (res) {
            // console.log(true);
            info = {
                status: 1,
                message:"登录成功"
            }

        } else {
            info = {
                status: 0,
                message:"登录失败"
            }

        }
        ctx.body = info;
    }
}